#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main() {
    int n;
    while (scanf("%d", &n) != EOF) 
    {
        int count = 0;
        for (int k = 1; k <= n; k++) {
            int j = 0;
            int a[50];
            int sum = 0;
            for (int i = 1; i <= sqrt(k); i++) {
                if (k % i == 0) {
                    a[j++] = i;
                    sum += a[j - 1];
                    if (i < k / i) {
                        a[j++] = k / i;
                        sum += a[j - 1];
                    }
                }
            }
            if (k == sum - k)
                count++;
        }
        printf("%d\n", count);
    }
    return 0;
}
